#coding=utf-8
"""
Author:朱燕珍
Time:2025/9/4 10:05
"""
import requests
class Send_Requests():
    '''封装了一个发送接口请求的工具类'''
    def __init__(self):
        '''创建session对象保持会话'''
        self.session = requests.session()
    def send(self,method,url,data=None,json=None,params=None,headers=None):
        method = method.lower()
        if method == 'get':
            response = self.session.get(url,params)
        elif method == 'post':
            response = self.session.post(url,data,headers)
        elif method == 'post_json':
            response = self.session.post(url,json,headers)
        elif method == 'delete':
            response = self.session.delete(url)
        return response
# 生产环境是什么？、//